package org.dxy.domain.event.substitute;

import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

import java.math.BigDecimal;

/**
 * 替代料更新事件
 * @author dxy
 * @createTime 2025/9/13
 */
public record SubstituteMaterialUpdatedEvent(
    /** MBOM ID */
    Long mbomId,
    /** 替代料ID */
    Long substituteId,
    /** 替代比例 */
    BigDecimal substituteRatio,
    /** 优先级 */
    Integer priority
) implements DomainEvent {
    
    @Override
    public Long aggregateId() {
        return mbomId;
    }
    
    @Override
    public String aggregateType() {
        return AggregateTypeEnum.MBOM.getKey();
    }
    
    @Override
    public String eventType() {
        return SubstituteMaterialEventTypeEnum.UPDATED.getKey();
    }
}